package com.wangmengtao.upms.service.impl;

import com.wangmengtao.upms.dao.UpmsDeptUserDao;
import com.wangmengtao.upms.dao.UpmsUserDao;
import com.wangmengtao.upms.model.UpmsDeptUser;
import com.wangmengtao.upms.model.UpmsUser;
import com.wangmengtao.upms.service.UpmsDeptUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: UpmsOrganizationUserServiceImpl
 * @Description: TODO
 * @Author: WangMengtao
 * @Data: 2019/6/5 17:15
 * @Version: 1.0.0
 */
@Service
public class UpmsDeptUserServiceImpl implements UpmsDeptUserService {
    @Autowired
    private UpmsDeptUserDao upmsDeptUserDao;
    @Autowired
    private UpmsUserDao upmsUserDao;

    @Override
    public int insert(UpmsDeptUser upmsDeptUser) {
        return 0;
    }

    @Override
    public int deleteById(Long id) {
        return 0;
    }

    @Override
    public int update(UpmsDeptUser upmsDeptUser) {
        return 0;
    }

    @Override
    public int deleteByIds(List<Long> ids) {
        return 0;
    }

    @Override
    public UpmsDeptUser getById(Long id) {
        return null;
    }

    @Override
    public List<UpmsDeptUser> list() {
        return null;
    }

    @Override
    public List<UpmsUser> listByDeptId(Long deptId) {
        List<UpmsUser> upmsUserList = new ArrayList<UpmsUser>();
        List<UpmsDeptUser> upmsDeptUserList = new ArrayList<UpmsDeptUser>();
        upmsDeptUserList = upmsDeptUserDao.listByDeptId(deptId);
        for (UpmsDeptUser upmsDeptUser:upmsDeptUserList){
            upmsUserList.add(upmsUserDao.getById(upmsDeptUser.getUserId()));
        }
        return upmsUserList;
    }
}
